package indi.zhifa.recipe.bailan.framework.auth.handler;
import indi.zhifa.recipe.bailan.framework.auth.property.SecurityConfig;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
@AllArgsConstructor
public class PasswdEncoderFactory {
    final SecurityConfig securityConfig;

    @Bean
    PasswordEncoder getPasswordEncoder(){
        return new BCryptPasswordEncoder(securityConfig.getPasswd().getStrength());
    }
}
